package user;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
@WebServlet(value = "/announcement")
public class announcementServlet extends HttpServlet {
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String action = request.getParameter("action");
        switch (action){
            case "addAnnouncement":
                request.getRequestDispatcher("/WEB-INF/user/addAnnouncement.jsp").forward(request, response);
                break;
            case "deleteAnnouncement":
                request.getRequestDispatcher("/WEB-INF/user/deleteAnnouncement.jsp").forward(request, response);
                break;
            case "findAllAnnouncements":
                request.getRequestDispatcher("/WEB-INF/user/findAllAnnouncements.jsp").forward(request, response);
        }
    }
}
